package seqAlignment;

public class LinearAlignmentScore implements AlignmentScore {

	int k;
	String str1;
	String str2;
	
	@Override
	public int score(int[][] matrix, int x, int y) {
		if (x*y==0) {
			return 0;
		}
		if (str1.charAt(x-1)==str2.charAt(y-1)) {
			return k;
		}
		return -k;
	}
	
	public LinearAlignmentScore (String str1, String str2, int k) {
		this.k = k;
		this.str1=str1;
		this.str2=str2;
	}

}
